// ****************************************************************************** 
// Copyright     :  Copyright (C) 2018, Hisilicon Technologies Co. Ltd.
// File name     :  usb3_dev_c_union_define.h
// Project line  :  Platform And Key Technologies Development
// Department    :  CAD Development Department
// Author        :  xxx
// Version       :  1
// Date          :  2013/3/10
// Description   :  The description of xxx project
// Others        :  Generated automatically by nManager V4.2 
// History       :  xxx 2018/04/10 11:53:36 Create file
// ******************************************************************************

#ifndef __USB3_DEV_C_UNION_DEFINE_H__
#define __USB3_DEV_C_UNION_DEFINE_H__

/* Define the union U_DCFG */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    rsv_0            : 7  ; /* [31:25] */
        unsigned int    stopondisconnect : 1  ; /* [24] */
        unsigned int    ignstrmpp        : 1  ; /* [23] */
        unsigned int    lpmcap           : 1  ; /* [22] */
        unsigned int    nump             : 5  ; /* [21:17] */
        unsigned int    intrnum          : 5  ; /* [16:12] */
        unsigned int    rsv_1            : 2  ; /* [11:10] */
        unsigned int    devaddr          : 7  ; /* [9:3] */
        unsigned int    devspd           : 3  ; /* [2:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_DCFG;

/* Define the union U_DCTL */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    run_stop        : 1  ; /* [31] */
        unsigned int    csftrst         : 1  ; /* [30] */
        unsigned int    rsv_2           : 1  ; /* [29] */
        unsigned int    hirdthres       : 5  ; /* [28:24] */
        unsigned int    appl1res        : 1  ; /* [23] */
        unsigned int    rsv_3           : 1  ; /* [22] */
        unsigned int    lpm_nyet_thres  : 2  ; /* [21:20] */
        unsigned int    keepconnect     : 1  ; /* [19] */
        unsigned int    l1hibernationen : 1  ; /* [18] */
        unsigned int    crs             : 1  ; /* [17] */
        unsigned int    css             : 1  ; /* [16] */
        unsigned int    rsv_4           : 3  ; /* [15:13] */
        unsigned int    initu2ena       : 1  ; /* [12] */
        unsigned int    acceptu2ena     : 1  ; /* [11] */
        unsigned int    initu1ena       : 1  ; /* [10] */
        unsigned int    acceptu1ena     : 1  ; /* [9] */
        unsigned int    ulstchngreq     : 4  ; /* [8:5] */
        unsigned int    tstctl          : 4  ; /* [4:1] */
        unsigned int    rsv_5           : 1  ; /* [0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_DCTL;

/* Define the union U_DEVTEN */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    rsv_6               : 15  ; /* [31:17] */
        unsigned int    eccerren            : 1  ; /* [16] */
        unsigned int    rsv_7               : 1  ; /* [15] */
        unsigned int    l1wkupevten         : 1  ; /* [14] */
        unsigned int    stopondisconnecten  : 1  ; /* [13] */
        unsigned int    vendevtstrcvden     : 1  ; /* [12] */
        unsigned int    rsv_8               : 1  ; /* [11] */
        unsigned int    rsv_9               : 1  ; /* [10] */
        unsigned int    errticerrevten      : 1  ; /* [9] */
        unsigned int    l1suspen            : 1  ; /* [8] */
        unsigned int    softevten           : 1  ; /* [7] */
        unsigned int    u3l2l1suspen        : 1  ; /* [6] */
        unsigned int    hibernationreqevten : 1  ; /* [5] */
        unsigned int    wkupevten           : 1  ; /* [4] */
        unsigned int    ulstcngen           : 1  ; /* [3] */
        unsigned int    connectdoneevten    : 1  ; /* [2] */
        unsigned int    usbrstevten         : 1  ; /* [1] */
        unsigned int    dissconnevten       : 1  ; /* [0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_DEVTEN;

/* Define the union U_DSTS */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    rsv_10      : 2  ; /* [31:30] */
        unsigned int    dcnrd       : 1  ; /* [29] */
        unsigned int    sre         : 1  ; /* [28] */
        unsigned int    rsv_11      : 2  ; /* [27:26] */
        unsigned int    rss         : 1  ; /* [25] */
        unsigned int    sss         : 1  ; /* [24] */
        unsigned int    coreidle    : 1  ; /* [23] */
        unsigned int    devctrlhlt  : 1  ; /* [22] */
        unsigned int    usblnkst    : 4  ; /* [21:18] */
        unsigned int    rxfifoempty : 1  ; /* [17] */
        unsigned int    soffn       : 14  ; /* [16:3] */
        unsigned int    connectspd  : 3  ; /* [2:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_DSTS;

/* Define the union U_DGCMDPAR */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    parameter : 32  ; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_DGCMDPAR;

/* Define the union U_DGCMD */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    rsv_12          : 16  ; /* [31:16] */
        unsigned int    cmdstatus_dgcmd : 4  ; /* [15:12] */
        unsigned int    rsv_13          : 1  ; /* [11] */
        unsigned int    cmdact_dgcmd    : 1  ; /* [10] */
        unsigned int    rsv_14          : 1  ; /* [9] */
        unsigned int    cmdioc_dgcmd    : 1  ; /* [8] */
        unsigned int    cmdtyp_dgcmd    : 8  ; /* [7:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_DGCMD;

/* Define the union U_DALEPENA */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    usbactep : 32  ; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_DALEPENA;

/* Define the union U_RSVD */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    rsv_15 : 32  ; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_RSVD;

/* Define the union U_DEPCMDPAR2[0:7] */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    parameter2 : 32  ; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_DEPCMDPAR2[0:7];

/* Define the union U_DEPCMDPAR1[0:7] */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    parameter1 : 32  ; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_DEPCMDPAR1[0:7];

/* Define the union U_DEPCMDPAR0[0:7] */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    parameter0 : 32  ; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_DEPCMDPAR0[0:7];

/* Define the union U_DEPCMD[0:7] */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    commandparam     : 16  ; /* [31:16] */
        unsigned int    cmdstatus_depcmd : 4  ; /* [15:12] */
        unsigned int    hipri_forcerm    : 1  ; /* [11] */
        unsigned int    cmdact_depcmd    : 1  ; /* [10] */
        unsigned int    rsv_16           : 1  ; /* [9] */
        unsigned int    cmdioc_depcmd    : 1  ; /* [8] */
        unsigned int    rsv_17           : 4  ; /* [7:4] */
        unsigned int    cmdtyp_depcmd    : 4  ; /* [3:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_DEPCMD[0:7];

/* Define the union U_DEV_IMOD[0] */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    device_imodc : 16  ; /* [31:16] */
        unsigned int    device_imodi : 16  ; /* [15:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_DEV_IMOD[0];


//==============================================================================
/* Define the global struct */
typedef struct
{
    volatile U_DCFG            DCFG            ; /* C700 */
    volatile U_DCTL            DCTL            ; /* C704 */
    volatile U_DEVTEN          DEVTEN          ; /* C708 */
    volatile U_DSTS            DSTS            ; /* C70C */
    volatile U_DGCMDPAR        DGCMDPAR        ; /* C710 */
    volatile U_DGCMD           DGCMD           ; /* C714 */
    volatile U_DALEPENA        DALEPENA        ; /* C720 */
    volatile U_RSVD            RSVD            ; /* C7A0 */
    volatile U_DEPCMDPAR2[0:7] DEPCMDPAR2[0:7] ; /* C9F0 */
    volatile U_DEPCMDPAR1[0:7] DEPCMDPAR1[0:7] ; /* C9F4 */
    volatile U_DEPCMDPAR0[0:7] DEPCMDPAR0[0:7] ; /* C9F8 */
    volatile U_DEPCMD[0:7]     DEPCMD[0:7]     ; /* C9FC */
    volatile U_DEV_IMOD[0]     DEV_IMOD[0]     ; /* C8A0 */

} S_usb3_dev_REGS_TYPE;

/* Declare the struct pointor of the module usb3_dev */
extern volatile S_usb3_dev_REGS_TYPE *gopusb3_devAllReg;

/* Declare the functions that set the member value */
int iSetDCFG_stopondisconnect(unsigned int ustopondisconnect);
int iSetDCFG_ignstrmpp(unsigned int uignstrmpp);
int iSetDCFG_lpmcap(unsigned int ulpmcap);
int iSetDCFG_nump(unsigned int unump);
int iSetDCFG_intrnum(unsigned int uintrnum);
int iSetDCFG_devaddr(unsigned int udevaddr);
int iSetDCFG_devspd(unsigned int udevspd);
int iSetDCTL_run_stop(unsigned int urun_stop);
int iSetDCTL_csftrst(unsigned int ucsftrst);
int iSetDCTL_hirdthres(unsigned int uhirdthres);
int iSetDCTL_appl1res(unsigned int uappl1res);
int iSetDCTL_lpm_nyet_thres(unsigned int ulpm_nyet_thres);
int iSetDCTL_keepconnect(unsigned int ukeepconnect);
int iSetDCTL_l1hibernationen(unsigned int ul1hibernationen);
int iSetDCTL_crs(unsigned int ucrs);
int iSetDCTL_css(unsigned int ucss);
int iSetDCTL_initu2ena(unsigned int uinitu2ena);
int iSetDCTL_acceptu2ena(unsigned int uacceptu2ena);
int iSetDCTL_initu1ena(unsigned int uinitu1ena);
int iSetDCTL_acceptu1ena(unsigned int uacceptu1ena);
int iSetDCTL_ulstchngreq(unsigned int uulstchngreq);
int iSetDCTL_tstctl(unsigned int utstctl);
int iSetDEVTEN_eccerren(unsigned int ueccerren);
int iSetDEVTEN_l1wkupevten(unsigned int ul1wkupevten);
int iSetDEVTEN_stopondisconnecten(unsigned int ustopondisconnecten);
int iSetDEVTEN_vendevtstrcvden(unsigned int uvendevtstrcvden);
int iSetDEVTEN_errticerrevten(unsigned int uerrticerrevten);
int iSetDEVTEN_l1suspen(unsigned int ul1suspen);
int iSetDEVTEN_softevten(unsigned int usoftevten);
int iSetDEVTEN_u3l2l1suspen(unsigned int uu3l2l1suspen);
int iSetDEVTEN_hibernationreqevten(unsigned int uhibernationreqevten);
int iSetDEVTEN_wkupevten(unsigned int uwkupevten);
int iSetDEVTEN_ulstcngen(unsigned int uulstcngen);
int iSetDEVTEN_connectdoneevten(unsigned int uconnectdoneevten);
int iSetDEVTEN_usbrstevten(unsigned int uusbrstevten);
int iSetDEVTEN_dissconnevten(unsigned int udissconnevten);
int iSetDSTS_dcnrd(unsigned int udcnrd);
int iSetDSTS_sre(unsigned int usre);
int iSetDSTS_rss(unsigned int urss);
int iSetDSTS_sss(unsigned int usss);
int iSetDSTS_coreidle(unsigned int ucoreidle);
int iSetDSTS_devctrlhlt(unsigned int udevctrlhlt);
int iSetDSTS_usblnkst(unsigned int uusblnkst);
int iSetDSTS_rxfifoempty(unsigned int urxfifoempty);
int iSetDSTS_soffn(unsigned int usoffn);
int iSetDSTS_connectspd(unsigned int uconnectspd);
int iSetDGCMDPAR_parameter(unsigned int uparameter);
int iSetDGCMD_cmdstatus_dgcmd(unsigned int ucmdstatus_dgcmd);
int iSetDGCMD_cmdact_dgcmd(unsigned int ucmdact_dgcmd);
int iSetDGCMD_cmdioc_dgcmd(unsigned int ucmdioc_dgcmd);
int iSetDGCMD_cmdtyp_dgcmd(unsigned int ucmdtyp_dgcmd);
int iSetDALEPENA_usbactep(unsigned int uusbactep);

int iSetDEPCMDPAR2[0:7]_parameter2(unsigned int uparameter2);
int iSetDEPCMDPAR1[0:7]_parameter1(unsigned int uparameter1);
int iSetDEPCMDPAR0[0:7]_parameter0(unsigned int uparameter0);
int iSetDEPCMD[0:7]_commandparam(unsigned int ucommandparam);
int iSetDEPCMD[0:7]_cmdstatus_depcmd(unsigned int ucmdstatus_depcmd);
int iSetDEPCMD[0:7]_hipri_forcerm(unsigned int uhipri_forcerm);
int iSetDEPCMD[0:7]_cmdact_depcmd(unsigned int ucmdact_depcmd);
int iSetDEPCMD[0:7]_cmdioc_depcmd(unsigned int ucmdioc_depcmd);
int iSetDEPCMD[0:7]_cmdtyp_depcmd(unsigned int ucmdtyp_depcmd);
int iSetDEV_IMOD[0]_device_imodc(unsigned int udevice_imodc);
int iSetDEV_IMOD[0]_device_imodi(unsigned int udevice_imodi);

#endif // __USB3_DEV_C_UNION_DEFINE_H__
